<?= form::open('register/register', array('class'=>'register_form')); ?>

<dl>
  <dt> <?= form::label('username', 'Login: '); ?></dt>
  	<? if (isset($o_Post['errors'])): ?> 
  	<dd> <? if (isset($o_Post['errors']['username'])) echo Kohana ::lang('validation.required', 'username'); ?> </dd>  
  	<dd>  <?= form::input('username', $o_Post['username']); ?></dd>
  	<?else: ?>
  	<dd>  <?= form::input('username'); ?></dd>
  	<? endif; ?>
  	
  <dt> <?= form::label('password', 'Password'); ?></dt> 
  	<dd> <? if (isset($o_Post['errors']['password'])) echo Kohana ::lang('validation.required', 'password'); ?> </dd> 
  	<dd> <?= form::password('password'); ?></dd>
  	
  <dt> <?= form::label('password2', 'Retype password'); ?></dt>
  	<dd> <? 
  		if (isset($o_Post['errors']['password2'])){
  			if ($o_Post['errors']['password2'] == 'required')
  				echo Kohana ::lang('validation.required', 'retype password'); 
  			else if ($o_Post['errors']['password2'] == 'matches')
 					echo Kohana ::lang('validation.matches', 'retype password', 'password');
		}
  		?> </dd> 
  	<dd> <?= form::password('password2'); ?></dd>
  	
  <dt> <?= form::label('email', 'Email: '); ?></dt> 
  	<? if (isset($o_Post['errors'])): ?> 
	  	<dd> <? 
  			if (isset($o_Post['errors']['email'])){ 
  				if ($o_Post['errors']['email'] == 'required')
  					echo Kohana ::lang('validation.required', 'E-mail'); 
  				else if ($o_Post['errors']['email'] == 'email')
  					echo Kohana ::lang('validation.valid_email', 'E-mail');
  			}
  			?> </dd> 
  		<dd><?= form::input('email', $o_Post['email']); ?></dd>
  	<?else: ?>
  		<dd><?= form::input('email'); ?></dd>
  	<?endif; ?>
  <dt> <?= form::label('reg', 'Register'); ?></dt> 
  	<dd><?= form::submit('reg', 'Register'); ?></dd>
</dl>
<?= form::close(); ?>